package com.thunder.component;

import java.awt.Color;
import java.awt.Graphics;

import com.thunder.utils.Constant;

public class Bullet {
	
	private final int radius;
	private final int velocity;	
	private final Color color;
	
	private final int posX;
	private int posY;
	
	private final int direction; 
	public Bullet(int x, int y, int dir) {
		
		radius = 10;
		velocity = 5;
		color = (dir == -1) ? Color.white : Color.yellow;
		
		posX = x;
		posY = y;
		
		direction = dir;
	}
	
	
	public void draw(Graphics g) {
		g.setColor(color);
		g.fillOval(posX, posY, radius, radius);
		
	}
	
	public void move()
	{
		posY += direction * velocity;
	}
	
	public int getX() {
		return posX;
	}
	
	public int getY() {
		return posY;
	}
	
	public int getDir() {
		return direction;
	}
	
}
